<!--
 * @Author: 追逐的娃 kangchao_php@163.com
 * @Date: 2024-10-31 13:58:04
 * @LastEditors: kangchao kangchao@sxdata.com.cn
 * @LastEditTime: 2024-11-27 11:12:12
 * @FilePath: \vue-project\src\components\Vue3Map\Index.vue
      <a-link @click="openMap('tian')">天地图</a-link>
 * @Description: 
 * 
-->
<template>
  <a-card>
    <h2 class="mb-2">地图</h2>
    <div class="w-sm flex justify-between">
      <a-link @click="openMap('amap')">高德地图</a-link>
      <a-link @click="openMap('baidu')">百度地图</a-link>
      <a-link @click="openMap('qq')">腾讯地图</a-link>
      <a-link @click="openMap('tian')">天地图</a-link>
    </div>
  </a-card>
  <!-- 地图盒子 -->
  <ViewMap :mapType="currentType" ref="mapRef" />
</template>

<script setup>
import { ref } from 'vue'
import ViewMap from './ViewMap.vue'

const currentType = ref('')
const mapRef = ref(null)

const openMap = (type) => {
  currentType.value = type
  mapRef.value.open()
}
</script>

<style lang="scss" scoped>
</style>